#include <cstdio>
#include <ctype.h>
using namespace std;
#define DEBUG
const char pre[]="https://www.luogu.com.cn/problem/";
signed main()
{
    #ifdef DEBUG
        freopen("../in.txt", "r", stdin);
        freopen("../out.txt", "w", stdout);
    #endif

    int n; scanf("%d", &n);
    while(n--)
    {
        char op[100]; scanf("%s", op);
        printf("%s", pre);
        if(isdigit(op[0])) printf("P");
        printf("%s\n", op);
    }
    return 0;
}